package com.wlscale.roadsystem.modular.setting;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.View;
import android.widget.TextView;

import com.easy.component.component.header.EasyHeaderBuilder;
import com.wlscale.roadsystem.R;
import com.wlscale.roadsystem.base.LZBaseActivity;
import com.wlscale.roadsystem.wiget.NumInputAlertDialog;

/**
 * 参数设置
 */
public class SettingParameterActivity extends LZBaseActivity implements View.OnClickListener {
    /**
     *
     */
    private EasyHeaderBuilder easyHeaderBuilder;
    /**
     * 空载左:
     */
    private TextView btn_left_idling_zero_edittext;

    /**
     * 空载右:
     */
    private TextView btn_right_idling_zero_edit_text;
    /**
     * 分度值
     */
    private TextView btn_division_text_view;
    /**
     * 抗震数字滤波左:
     */
    private TextView btn_left_aseismatic_filtering_edit_text;
    /**
     * 抗震数字滤波右:
     */
    private TextView btn_right_aseismatic_filtering_edit_text;
    /**
     * 轴重平滑滤波左:
     */
    private TextView btn_left_smoothing_filtering_edit_text;
    /**
     * 抗震数字滤波右:
     */
    private TextView btn_right_smoothing_filtering_edit_text;
    /**
     * 轮轴称重消抖时间左:
     */
    private TextView btn_left_eliminate_dithering_time_edit_text;
    /**
     * 轮轴称重消抖时间右:
     */
    private TextView btn_right_eliminate_dithering_time_edit_text;

    @Override
    public void initlayoutResID() {
        setContentView(R.layout.activity_system_correct);
    }

    @Override
    public void initBundle() {

    }

    @Override
    public void initView() {
        btn_left_idling_zero_edittext = findViewById(R.id.btn_left_idling_zero_edittext);
        btn_right_idling_zero_edit_text = findViewById(R.id.btn_right_idling_zero_edit_text);
        btn_division_text_view = findViewById(R.id.btn_division_text_view);
        btn_left_aseismatic_filtering_edit_text = findViewById(R.id.btn_left_aseismatic_filtering_edit_text);
        btn_right_aseismatic_filtering_edit_text = findViewById(R.id.btn_right_aseismatic_filtering_edit_text);
        btn_left_smoothing_filtering_edit_text = findViewById(R.id.btn_left_smoothing_filtering_edit_text);
        btn_right_smoothing_filtering_edit_text = findViewById(R.id.btn_right_smoothing_filtering_edit_text);
        btn_left_eliminate_dithering_time_edit_text = findViewById(R.id.btn_left_eliminate_dithering_time_edit_text);
        btn_right_eliminate_dithering_time_edit_text = findViewById(R.id.btn_right_eliminate_dithering_time_edit_text);

        btn_left_idling_zero_edittext.setOnClickListener(this);
        btn_right_idling_zero_edit_text.setOnClickListener(this);
        btn_division_text_view.setOnClickListener(this);
    }

    @Override
    public void initHeader() {
        easyHeaderBuilder = new EasyHeaderBuilder(this);
        easyHeaderBuilder.addLeftImageBackView();
        easyHeaderBuilder.setTitle("参数设定");
        easyHeaderBuilder.addLeftImageBackListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finishActivity();
            }
        });
    }

    @Override
    public void initLoadingView() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_left_idling_zero_edittext:
                showNumInputAlert("温馨提示", "还是看的哈哈的", "确定", new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {

                    }
                }, "取消", new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {

                    }
                });
                break;
            case R.id.btn_right_idling_zero_edit_text:

                break;
            case R.id.btn_division_text_view:
                dialogChoice();
                break;
        }
    }

    /**
     * 单选
     */
    private void dialogChoice() {
        final String items[] = {"1", "2", "3","4","5","10","20","40","60","80","100"};
        AlertDialog.Builder builder = new AlertDialog.Builder(this, 0);
        builder.setTitle("请选择分度值");
        builder.setSingleChoiceItems(items, 0,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
        builder.create().show();

    }
}
